From: Jure Kajzer Date: Fri, 27 Nov 2009 11:12:40 +0000 (+0000) Subject: *(bug 20717) Added checkboxes to users with bot and ssop group membership X-Git-Tag: 1.31.0-rc.0~38701 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=267d1b7379d3de0dcf26604f85f05f2afb72de55;p=lhc%2Fweb%2Fwiklou.git *(bug 20717) Added checkboxes to users with bot and ssop group membership --- diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index 0870fc3285..a5f1b3c109 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -40,9 +40,29 @@ class ActiveUsersPager extends UsersPager { $this->requestedUser = $username->getText(); } } + + $this->setupOptions(); + parent::__construct(); } + public function setupOptions() { + global $wgRequest; + + $this->opts = new FormOptions(); + + $this->opts->add( 'hidebots', false, FormOptions::BOOL ); + $this->opts->add( 'hidesysops', false, FormOptions::BOOL ); + + $this->opts->fetchValuesFromRequest( $wgRequest ); + + $this->groups = array(); + if ($this->opts->getValue('hidebots') == 1) + $this->groups['bot'] = true; + if ($this->opts->getValue('hidesysops') == 1) + $this->groups['sysop'] = true; + } + function getIndexField() { return 'rc_user_text'; } @@ -54,6 +74,7 @@ class ActiveUsersPager extends UsersPager { $conds = array( 'rc_user > 0' ); // Users - no anons $conds[] = 'ipb_deleted IS NULL'; // don't show hidden names $conds[] = "rc_log_type IS NULL OR rc_log_type != 'newusers'"; + if( $this->requestedUser != '' ) { $conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser ); } @@ -88,6 +109,8 @@ class ActiveUsersPager extends UsersPager { $list = array(); foreach( self::getGroups( $row->user_id ) as $group ) { + if (isset($this->groups[$group])) + return; $list[] = self::buildGroupLink( $group ); } $groups = $wgLang->commaList( $list ); @@ -106,17 +129,25 @@ class ActiveUsersPager extends UsersPager { function getPageHeader() { global $wgScript, $wgRequest; + $self = $this->getTitle(); $limit = $this->mLimit ? Xml::hidden( 'limit', $this->mLimit ) : ''; - return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . # Form tag - Xml::fieldset( wfMsg( 'activeusers' ) ) . "\n" . - Xml::hidden( 'title', $self->getPrefixedDBkey() ) . - $limit . "\n" . - Xml::inputLabel( wfMsg( 'activeusers-from' ), 'username', 'offset', 20, $this->requestedUser ) . ' ' . # Username field - Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .# Submit button and form bottom - Xml::closeElement( 'fieldset' ) . - Xml::closeElement( 'form' ); + $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); # Form tag + $out .= Xml::fieldset( wfMsg( 'activeusers' ) ) . "\n"; + $out .= Xml::hidden( 'title', $self->getPrefixedDBkey() ) . $limit . "\n"; + + $out .= Xml::inputLabel( wfMsg( 'activeusers-from' ), 'username', 'offset', 20, $this->requestedUser ) . '
';# Username field + + $out .= Xml::checkLabel( wfMsg('activeusers-hidebots'), 'hidebots', 'hidebots', $this->opts->getValue( 'hidebots' ) ); + + $out .= Xml::checkLabel( wfMsg('activeusers-hidesysops'), 'hidesysops', 'hidesysops', $this->opts->getValue( 'hidesysops' ) ) . '
'; + + $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n";# Submit button and form bottom + $out .= Xml::closeElement( 'fieldset' ); + $out .= Xml::closeElement( 'form' ); + + return $out; } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index d9ff399d07..c9ab553d0d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2487,6 +2487,8 @@ Supported protocols: $1', 'activeusers-intro' => 'This is a list of users who had some kind of activity within the last $1 {{PLURAL:$1|day|days}}.', 'activeusers-count' => '$1 {{PLURAL:$1|edit|edits}} in the last {{PLURAL:$3|day|$3 days}}', 'activeusers-from' => 'Display users starting at:', +'activeusers-hidebots' => 'Hide bots', +'activeusers-hidesysops' => 'Hide sysops', 'activeusers-noresult' => 'No users found.', # Special:Log/newusers